<?php

namespace App\ModelFilters;

use EloquentFilter\ModelFilter;

class CzProductBlackFilter extends BaseFilter
{
    /**
     * Related Models that have ModelFilters as well as the method on the ModelFilter
     * As [relationMethod => [input_key1, input_key2]].
     *
     * @var array
     */
    public $relations = [];
    public function status($value)
    {
        return $this->where('status', $value);
    }
    public function mobile($value)
    {
        return $this->where('mobile', $value);
    }
    public function spec_id($value)
    {
        return $this->where('spec_id', $value);
    }
    public function created_at($createTime)
    {
        // print_r($createTime);
        // 13 为是毫秒
        if (strlen($createTime[0]) == 13) {
            $createTime[0] = $createTime[0] / 1000;
        }
        if (strlen($createTime[1]) == 13) {
            $createTime[1] = $createTime[1] / 1000;
        }
        return $this->whereBetween('created_at', $createTime);
        // return $this;
    }
}
